package valerij_timakov.home_finances.logic;

import java.util.Map;

import valerij_timakov.home_finances.data.user.UserItem;
import valerij_timakov.home_finances.exceptions.AppExceptionWrongState;
import valerij_timakov.home_finances.exceptions.AppPersProviderException;
import valerij_timakov.home_finances.persistent.storages.user.IUserStorage;

public class UserWorker {
	
	private IUserStorage storage;
	
	public UserWorker(IUserStorage storage) throws AppExceptionWrongState {
		if (storage == null) {
			throw new AppExceptionWrongState("Не задан провайдер данных!");
		}
		this.storage = storage;
	}
	
	public Map<Long, UserItem> getUsers(long ... userIds) throws AppPersProviderException, AppExceptionWrongState {
		return storage.getUsers(userIds);
	}
}
